//
//  WKDelegateController.swift
//  ZMWEIBO
//
//  Created by 庄猛 on 16/12/23.
//  Copyright © 2016年 BeiSheng. All rights reserved.
//

import UIKit
import WebKit


protocol WKDelegateControllerDelegate :NSObjectProtocol {

    func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage)

}

class WKDelegateController: UIViewController {

    weak var delegate : WKDelegateControllerDelegate?


    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    


}

extension WKDelegateController:WKScriptMessageHandler{
    func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {

        delegate?.userContentController(userContentController, didReceive: message)
    }



}
